package io;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author IT枫斗者
 * @ClassName writerDemo01.java
 * @From www.javatiaozao.com
 * @Description TODO
 */
public class writerDemo01 {
    public static void main(String[] args) throws IOException {


        FileWriter fw = new FileWriter("myStream/222.txt");

        //void write(int c);写入一个字节
        fw.write(97);
        fw.write(99);

        //void write(char[] chs)：写入一个字符数组
        char[] chs = {'1','a','枫','斗','者'};
//       fw.write(chs);
        //我们想要只写入一部分，void write(char[] chs,int off,int len);
        fw.write(chs,1,3);

        //void write(String str):写入一个字符串
        fw.write("dafasdf");
        //关闭流，关闭之前刷新一下
        fw.flush();
        fw.close();
    }
}
